package protocol

import (
	"gitee.com/crack007/goose/gscore/server"
	"gitee.com/crack007/proxy/src/proxy/protocol/protoredis"

	"gitee.com/crack007/proxy/src/proxy/protocol/prototcp"

	"gitee.com/crack007/proxy/src/proxy/protocol/protomysql"
)

func NewMysql(session *server.Session) *protomysql.Mysql {
	mysql := &protomysql.Mysql{
		MysqlClient: protomysql.NewMysqlClient(),
		MysqlServer: protomysql.NewMysqlServer(),
		Session:     session,
	}
	return mysql
}

func NewRedis(session *server.Session) *protoredis.Redis {
	return &protoredis.Redis{
		Session: session,
		Exclude: make(map[string]bool),
	}
}

func NewTcp(session *server.Session, output string) *prototcp.Tcp {
	return &prototcp.Tcp{
		Session: session,
		Output:  output,
	}
}
